private void User(HttpServletRequest request,
        HttpServletResponse response) throws ServletException, IOException{
        SimsSystemUser user =  (SimsSystemUser) request.getSession().getAttribute("user");
        SimsSystemUser userNow = userService.findUserById(user.getUserId());

        Hibernate.initialize(userNow.getDepartment());
        Hibernate.initialize(userNow.getSystemRole());

        request.setAttribute("userNow", userNow);
        request.getRequestDispatcher("/jsps/user/personal.jsp").forward(request, response);//显示当前用户的个人信息

        }
/*跳转到信息修改页面*/
private void forUpdateUser(HttpServletRequest request,
        HttpServletResponse response) throws ServletException, IOException{
        //找到保存到session中的登录用户
        SimsSystemUser user =  (SimsSystemUser) request.getSession().getAttribute("user");
        //通过用户id重新查找用户
        SimsSystemUser userNow = userService.findUserById(user.getUserId());

        Hibernate.initialize(userNow.getDepartment());
        Hibernate.initialize(userNow.getSystemRole());


        request.setAttribute("userNow", userNow);
        request.getRequestDispatcher("/jsps/user/forchangepersonal.jsp").forward(request, response);
        }




/**
 * 用户修改密码
 * @param request
 * @param response
 * @throws IOException
 * @throws ServletException
 * @author Harry
 */
private void changePassword(HttpServletRequest request,
        HttpServletResponse response) throws IOException, ServletException{
        System.out.println("执行到了changePassword函数");
        PrintWriter pw = response.getWriter();
        //找到保存到session中的登录用户
        SimsSystemUser user =  (SimsSystemUser) request.getSession().getAttribute("user");
        //通过用户id重新查找用户
        SimsSystemUser userNow = userService.findUserById(user.getUserId());

        //加载用户所属部门和角色，解决懒加载的问题
        Hibernate.initialize(userNow.getDepartment());
        Hibernate.initialize(userNow.getSystemRole());

        String oldpwd = request.getParameter("oldpwd");//旧密码
        String newpwd = request.getParameter("newpwd");//新密码
        String confirm = request.getParameter("confirm");//确认新密码

        String pwd = userNow.getSuPassword();//得到该客户当前的字符串
        String MDoldpwd = md5.getMD5(oldpwd);
        try{
        if(MDoldpwd.equals(pwd)){ //输入的旧密码与原密码一致
        if(newpwd.equals(confirm)){//判断输入的两个新密码是否一致
        if(!(md5.getMD5(newpwd).equals(pwd))){//如果新密码与原密码不同，执行更新密码操作
        userNow.setSuPassword(md5.getMD5(newpwd));
        exit(request, response);
        }else if(md5.getMD5(newpwd).equals(pwd)){
        throw new ApplicationException("密码没有改动");
        }
        }else{
        throw new ApplicationException("抱歉，密码输入不一致");
        }
        }else{
        throw new ApplicationException("旧密码输入错误");
        }
        }catch(Exception e){
        request.setAttribute("error", e);

        request.getRequestDispatcher("/jsps/error.jsp").forward(request, response);

        }

        }
